<?php

declare(strict_types=1);
namespace Service\AppService;
use Service\BaseService;
use Hyperf\Utils\ApplicationContext;
class IdService extends BaseService
{
    /**
     * 获取订单ID
     * @return string
     */
    public function getOmsID()
    {
        $container = ApplicationContext::getContainer();
        $generator = $container->get(SnowFlakeService::class);
        return (string)$generator->getOmsIDGenerate();
    }
    
    /**
     * 获取商品写入ID
     */
    public function getGoodsID()
    {
        $container = ApplicationContext::getContainer();
        $generator = $container->get(SnowFlakeService::class);
        return (string)$generator->getGoodsIDGenerate();
    }
    
    /**
     * 获取日志写入ID
     */
    public function getLogID()
    {
        $container = ApplicationContext::getContainer();
        $generator = $container->get(SnowFlakeService::class);
        return (string)$generator->getLogIDGenerate();
    }
    
    /**
     * 获取其它服务写入ID
     */
    public function getOtherID()
    {
        $container = ApplicationContext::getContainer();
        $generator = $container->get(SnowFlakeService::class);
        return (string)$generator->getOtherIDGenerate();
    }
}